var jq = jQuery.noConflict();

function getLoginName(){

    var yonghu=JSON.parse(localStorage.getItem('obj'));
    if(yonghu!=null){
        var token=yonghu.token;
        var loginName=yonghu.user1.userName;
        var id=yonghu.user1.id;
        var type=yonghu.user1.type;
    }

    var html = jq('.sou>.fr>:first').html('');

    // alert("loginName:"+loginName);
    if(loginName != null){    //已经登录
        if(type == 1){  //管理员
            jq('.sou>.fr>:first').html('你好，<a href="Member.html?id='+id+'" target="_blank" name="buyUserId" userId="'+id+'">'+loginName+'</a> &nbsp;|&nbsp;<a href="Admin.html?userid='+id+'" target="_blank">系统管理</a>&nbsp;&nbsp;|&nbsp;<a href="Index.html" onclick="leave();">注销</a> &nbsp;|&nbsp;<a href="userOrderList.html?userid='+id+'" target="_blank">我的订单</a>&nbsp;|');
        }else{  //普通用户
            jq('.sou>.fr>:first').html('你好，<a href="Member.html?id='+id+'" target="_blank" name="buyUserId" userId="'+id+'">'+loginName+'</a>&nbsp;|&nbsp;<a href="Index.html" onclick="leave();">注销</a>&nbsp;|&nbsp;<a href="userOrderList.html?userid='+id+'" target="_blank">我的订单</a>&nbsp;|');
        }
        return true;
    }else{  //未登录
        jq('.sou>.fr>:first').html('你好，请<a href="Login.html">登录</a>&nbsp; <a href="Regist.html" style="color:#ff4e00;">免费注册</a>&nbsp;|');
        return false;
    }
}